package com.rabbiter.association.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.rabbiter.association.converter.StatusConverter;
import com.rabbiter.association.converter.UserTypeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * 数据实体类
 * 系统用户
 */
@Getter
@Setter
@TableName(value = "users")
@ApiModel(description = "用户实体")
public class Users implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 记录ID
     */
    @ExcelIgnore  // 不导出ID
    @TableId(value = "id")
    @ApiModelProperty(value = "用户ID")
    private String id;

    /**
     * 用户账号
     */
    @ExcelProperty(value = "用户账号", index = 0)
    @TableField(value = "user_name")
    @ApiModelProperty(value = "用户名")
    private String userName;

    @ExcelIgnore  // 不导出密码
    /*
     * 用户密码
     * */
    @TableField(value = "pass_word")
    @ApiModelProperty(value = "密码")
    private String passWord;

    @ExcelProperty(value = "姓名", index = 1)
    /*
     * 用户姓名
     */
    @TableField(value = "name")
    @ApiModelProperty(value = "姓名")
    private String name;

    @ExcelProperty(value = "性别", index = 2)
    /*
     * 用户性别
     */
    @TableField(value = "gender")
    @ApiModelProperty(value = "性别")
    private String gender;

    /**
     * 用户年龄
     */
    @ExcelProperty(value = "年龄", index = 3)
    @TableField(value = "age")
    private Integer age;

    /**
     * 联系电话
     */
    @ExcelProperty(value = "联系电话", index = 4)
    @TableField(value = "phone")
    @ApiModelProperty(value = "手机号")
    private String phone;

    /**
     * 联系地址
     */
    @ExcelProperty(value = "联系地址", index = 5)
    @TableField(value = "address")
    private String address;

    /**
     * 信息状态
     */
    @ExcelProperty(value = "状态", index = 6, converter = StatusConverter.class)
    @TableField(value = "status")
    @ApiModelProperty(value = "状态(0-禁用,1-启用)")
    private Integer status;

    /**
     * 添加时间
     */
    @ExcelProperty(value = "添加时间", index = 7)
    @TableField(value = "create_time")
    @ApiModelProperty(value = "创建时间")
    private String createTime;

    /**
     * 用户身份
     */
    @ExcelProperty(value = "用户身份", index = 8, converter = UserTypeConverter.class)
    @TableField(value = "type")
    @ApiModelProperty(value = "用户类型(0-管理员,1-社团管理员,2-普通用户)")
    private Integer type;
}


